﻿#region Includes

using System.Collections.Generic;
using WaveTech.GShield.Model;

#endregion

namespace WaveTech.GShield.Data.Collections
{
	public class UsageLogsCollection : List<UsageLog>
	{
		public int GetTotalPlayMinutes()
		{
			int total = 0;

			for (int i = 0; i < Count; i++)
			{
				if (this[i].TimeType.Value == (int) TimeType.Minutes)
				{
					if (this[i].Time.HasValue)
						total += this[i].Time.Value;
				}
				else if (this[i].TimeType.Value == (int) TimeType.Minutes)
				{
					if (this[i].Time.HasValue)
						total += (this[i].Time.Value*60);
				}
			}

			return total;
		}
	}
}